import re

res=[]


f= open("oo").readlines()
for i in f:
    result2 = re.findall('[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}', i)
    if not result2  == []:
        res.append(result2[0]+"\n")

w=open("ip",'w')
w.writelines(res)